<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8"/>
    <title>用户查询</title>
    <meta name="keywords" content="user,personal,manage"/>
    <meta name="description" content="用户管理,用户查询"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <link rel="stylesheet" href="./assets/css/validationEngine.jquery.css" type="text/css">
    <link rel="stylesheet" href="./assets/css/datepicker.css"/>
    <!-- basic styles -->
</head>

<body>
<div class="page-content page-content2">
    <div class="row">
        <div class="col-xs-12">
            <form id="stationFormId" class="form-horizontal" role="form">
                <div class="topSearchBox">
                    <div class="input-group input-group-sm input-group-sm3">
                        <span class="input-group-addon group-addon group-addon2">昵称</span>
                        <span class="spanIcons"></span>
                        <input type="text" class="form-control form-control-two" id="nickname">
                    </div>

                    <div class="input-group input-group-sm input-group-sm3">
                        <span class="input-group-addon group-addon">手机号码</span>
                        <span class="spanIcons"></span>
                        <input type="text" class="form-control form-control-two validate[custom[number]]" id="phoneno">
                    </div>
                    <div class="input-group input-group-sm input-group-sm3">
                        <span class="input-group-addon group-addon">性别</span>
                        <span class="spanIcons"></span>
                        <select class="form-control form-control-two" id="gender">
                            <option value="">不限</option>
                            <option value="1">男</option>
                            <option value="2">女</option>
                        </select>
                    </div>
                    <div class="input-group input-group-sm input-group-sm3">
                        <span class="input-group-addon group-addon">推荐关注</span>
                        <span class="spanIcons"></span>
                        <select class="form-control form-control-two" id="userRecommendType">
                            <option value="">全部</option>
                            <option value="1">推荐用户</option>
                            <option value="0">未推荐用户</option>
                        </select>
                    </div>
                    <div class="input-group input-group-sm input-group-sm3">
                        <span class="input-group-addon group-addon">用户类型</span>
                        <span class="spanIcons"></span>
                        <select class="form-control form-control-two" id="userType">
                            <option value="">全部</option>
                            <option value="1">真实用户</option>
                            <option value="2">虚拟用户</option>
                        </select>
                    </div>
                    <div class="input-group input-group-sm input-group-sm4">
                        <span class="input-group-addon group-addon">省</span>
                        <span class="spanIcons"></span>
                        <select class="form-control form-control-five" id="provinceName">
                        </select>
                    </div>
                    <div class="input-group input-group-sm input-group-sm4">
                        <span class="input-group-addon group-addon">市</span>
                        <span class="spanIcons"></span>
                        <select class="form-control form-control-five" id="cityName">
                        </select>
                    </div>
                </div>
                <div class="topSearchBox">
                    <div class="input-group input-group-sm input-group-sm3">
                        <span class="input-group-addon group-addon">注册日期</span>
                        <input class="form-control date-picker form-control-three" id="startdate"
                               type="text" data-date-format="yyyy-mm-dd"/>
                        <span class="positi"> 至 </span>
                        <input class="form-control date-picker form-control-four" id="enddate"
                               type="text" data-date-format="yyyy-mm-dd"/>
                    </div>
                    <!--<div class="input-group input-group-sm input-group-sm3">-->
                        <!--<span class="input-group-addon group-addon">群组数</span>-->
                        <!--<input class="form-control form-control-three" id="startdate"-->
                               <!--type="text" data-date-format="yyyy-mm-dd"/>-->
                        <!--<span class="positi"> 至 </span>-->
                        <!--<input class="form-control form-control-four" id="enddate"-->
                               <!--type="text" data-date-format="yyyy-mm-dd"/>-->
                    <!--</div>-->
                    <div class="input-group input-group-sm input-group-sm3">
                        <span class="input-group-addon group-addon">帖子数</span>
                        <input class="form-control form-control-three validate[custom[number]]" id="minArticles"
                               type="text" data-date-format="yyyy-mm-dd"/>
                        <span class="positi"> 至 </span>
                        <input class="form-control form-control-four validate[custom[number]]" id="maxArticles"
                               type="text" data-date-format="yyyy-mm-dd"/>
                    </div>
                    <div class="input-group input-group-sm input-group-sm3">
                        <span class="input-group-addon group-addon">好友数</span>
                        <input class="form-control form-control-three validate[custom[number]]" id="minFriends"
                               type="text" data-date-format="yyyy-mm-dd"/>
                        <span class="positi"> 至 </span>
                        <input class="form-control form-control-four validate[custom[number]]" id="maxFriends"
                               type="text" data-date-format="yyyy-mm-dd"/>
                    </div>
                    <div class="input-group input-group-sm input-group-sm3" style="margin-left: 73px;">
                        <button type="submit" id="dataSearch" class="btn btn-primary btn-sm" title="查询">
                            <i class="icon-search nav-search-icon"></i>
                        </button>
                        <button id="dataadd" type="button" class="btn btn-primary btn-sm"
                                data-toggle="modal" data-target="#addModal" title="添加用户">
                            <i class="icon-plus-sign bigger-120"></i>
                        </button>
                        <button id="exportUser" type="button" class="btn btn-sm btn-success"
                                title="导出用户">
                            <!--<i class="icon-plus-sign bigger-120"></i>-->
                            导出
                        </button>
                    </div>
                </div>
            </form>
            <div class="row" style="margin-top: 0px;">
                <div class="col-xs-12">
                    <!-- PAGE CONTENT BEGINS -->
                    <table id="user_table" class="table"></table>
                    <!-- PAGE CONTENT ENDS -->
                </div>
                <!-- /.col -->
            </div>
        </div>
    </div>
</div>
<!-- /.page-content -->
<!-- 添加的modal start-->
<div class="modal fade bs-example-modal-lg" id="addModal" tabindex="-1">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"
                        aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title" id="exampleModalLabel">新增用户</h4>
            </div>
            <div class="modal-body">
                <form class="form-horizontal" id="addForm" data-type="add">
                    <div class="form-group">
                        <label for="addPageAddImg" class="col-sm-2 control-label">用户头像</label>
                        <div class="col-sm-10" style="position:relative;">
                            <p style="margin-top: 5px;">请上传200*200px尺寸,正方形的图片</p>
                            <!-- <img onclick="getElementById('addPageAddImg').click()"
                                 style="cursor:pointer;border: 1px solid #AABBCC;" title="点击添加图片" alt="点击添加图片"
                                 src="./assets/images/addImg.jpg" /> -->
                            <a href="#">
                                <input class="putbox validate[required]" type="file" name="image" id="addPageAddImg"/>
                                <div id="bord">
                                    <img class="imgbox" id="merchantImgs">
                                </div>
                            </a>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="name" class="col-sm-2 control-label">头像地址</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control validate[required]" id="userImg"
                                   name="openid" value="" placeholder="添加图片即可得到图片地址" readonly/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="name" class="col-sm-2 control-label">昵称</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control validate[required],maxSize[10]" id="name"
                                   name="openid" value="" placeholder="请输入昵称"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="phoneNum" class="col-sm-2 control-label">手机号码</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control validate[required,custom[phone]]" id="phoneNum"
                                    value="" placeholder="请输入手机号码"/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="passWord" class="col-sm-2 control-label">验证码</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control validate[required,minSize[6],maxSize[6]]" id="passWord"
                                    value="" placeholder="请输入手机号码"/>
                        </div>
                    </div>
                    <div  class="form-group" id="addGender">
                        <label for="" class="col-sm-2 control-label">性别</label>
                        <div class="col-sm-10" style="padding-left: 0px; padding-top: 0px; margin-top: -5px;">
                            <div class="radio col-sm-2" style="padding-left: 10px;">
                                <label> <input name="gender" type="radio" value="1"
                                               class="ace"/> <span class="lbl"> 男</span>
                                </label>
                            </div>
                            <div class="radio col-sm-2" style="padding-left: 8px;">
                                <label> <input name="gender" type="radio" value="2"
                                               class="ace" checked="checked"/> <span class="lbl"> 女</span>
                                </label>
                            </div>
                            <!--<div class="radio col-sm-2" style="padding-left: 0px;">-->
                                <!--<label> <input name="gender" type="radio" value="0"-->
                                               <!--class="ace"/> <span class="lbl"> 保密</span>-->
                                <!--</label>-->
                            <!--</div>-->
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="bornDate" class="col-sm-2 control-label">出生日期</label>
                        <div class="col-sm-10">
                            <span style="position: relative; z-index: 9999;">
                                <input type="text" class="form-control date-picker" id="bornDate" name="city"
                                       value="" placeholder="请输入出生日期" data-date-format="yyyy-mm-dd"/>
                            </span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="jobName" class="col-sm-2 control-label">职业名称</label>
                        <div class="col-sm-10">
                            <!--<input type="text" class="form-control validate[required]" id="jobName" name="city"-->
                                   <!--value="曲靖市" placeholder="请输入工作名称"/>-->
                            <select id="jobName" style="width: 100%;" class="validate[required]">

                            </select>
                        </div>
                    </div>
                    <div class="form-group" hidden>
                        <label for="bornDate" class="col-sm-2 control-label">经度</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="longitude" name="city"
                                   value="曲靖市" placeholder="请输入出生日期"/>
                        </div>
                    </div>
                    <div class="form-group" hidden>
                        <label for="bornDate" class="col-sm-2 control-label">纬度</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="latitude" name="city"
                                   value="曲靖市" placeholder="请输入出生日期"/>
                        </div>
                    </div>
                    <div id="wrap" class="form-group">
                        <label for="userType" class="col-sm-2 control-label">用户类型</label>
                        <div class="col-sm-10">
                            <select id="type" style="width: 100%;">
                                <!--<option value="1">真实用户</option>-->
                                <option value="2" selected="selected">虚拟用户</option>
                            </select>
                            <!--<div class="radio col-sm-2" style="padding-left: 10px;">-->
                                <!--<label> <input name="gender" type="radio" value="1"-->
                                               <!--class="ace"/> <span class="lbl"> 公众用户</span>-->
                                <!--</label>-->
                            <!--</div>-->
                            <!--<div class="radio col-sm-2" style="padding-left: 8px;">-->
                                <!--<label> <input name="gender" type="radio" value="2"-->
                                               <!--class="ace"/> <span class="lbl"> 系统用户</span>-->
                                <!--</label>-->
                            <!--</div>-->
                            <!--<div class="radio col-sm-2" style="padding-left: 0px;">-->
                                <!--<label> <input name="gender" type="radio" value="3"-->
                                               <!--class="ace"/> <span class="lbl"> 组织单位</span>-->
                                <!--</label>-->
                            <!--</div>-->
                        </div>
                    </div>
                    <div id="wrap" class="form-group">
                        <label for="userType" class="col-sm-2 control-label">国家</label>
                        <div class="col-sm-10">
                            <select id="countryName" name="countryName" style="width: 100%;">

                            </select>
                        </div>
                    </div>
                    <div id="wrap" class="form-group">
                        <label for="userType" class="col-sm-2 control-label">省</label>
                        <div class="col-sm-4">
                            <select id="addProvinceName" style="width: 100%;">

                            </select>
                        </div>
                        <label for="userType" class="col-sm-2 control-label">市</label>
                        <div class="col-sm-4">
                            <select id="addCityName" style="width: 100%;">

                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="address" class="col-sm-2 control-label">地址</label>
                        <div class="col-sm-10 input-group">
                            <input type="text" class="form-control validate[required]" id="address"
                                   name="phoneNo" value="" placeholder="请输入地址"/>
                            <span class="input-group-btn">
                                <button class="btn btn-sm btn-default" type="button" data-toggle="modal" data-target="#positionModal">定位</button>
                            </span>
                        </div>
                    </div>
                    <div class="form-group" style="padding-left: 106px;margin-bottom: 0;">
                        <input id="autoAgreeAddMe" checked type="checkbox" />开启自动确认加好友
                        <p style="padding-left: 12px;">开启后，任何用户加此帐号时，自动成为好友关系</p>
                    </div>
                </form>
            </div>
            <div class="modal-footer">
                <button class="btn btn-primary" form="addForm" type="submit">保存</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>

<!-- 修改的modal start-->
<div class="modal fade" id="updateModal" tabindex="-1">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"
                        aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title" id="exampleModalLabel">修改用户</h4>
            </div>
            <div class="modal-body">
                <form class="form-horizontal" id="updateForm" data-type="update">
                    <div class="form-group">
                        <label for="updatePageAddImg" class="col-sm-2 control-label">用户头像</label>
                        <div class="col-sm-10" style="position:relative;">
                            <p style="margin-top: 5px;">请上传200*200px尺寸,正方形的图片</p>
                            <!-- <img onclick="getElementById('addPageAddImg').click()"
                                 style="cursor:pointer;border: 1px solid #AABBCC;" title="点击添加图片" alt="点击添加图片"
                                 src="./assets/images/addImg.jpg" /> -->
                            <a href="#">
                                <input class="putbox validate[required]" type="file" name="image" id="updatePageAddImg"/>
                                <div id="bord">
                                    <img class="imgbox" id="updateImg01">
                                </div>
                            </a>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="updateImg" class="col-sm-2 control-label">头像地址</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control validate[required]" id="updateImg"
                                   name="openid" value="" placeholder="添加图片即可得到图片地址" readonly/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="updateName" class="col-sm-2 control-label">昵称</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control validate[required]" id="updateName"
                                   name="openid" value="" placeholder="请输入昵称"/>
                        </div>
                    </div>
                    <div class="form-group" id="updateGender">
                        <label for="" class="col-sm-2 control-label">性别</label>
                        <div class="col-sm-10" style="padding-left: 0px; padding-top: 0px; margin-top: -5px;">
                            <div class="radio col-sm-2" style="padding-left: 10px;">
                                <label> <input name="gender" type="radio" value="1"
                                               class="ace"/> <span class="lbl"> 男</span>
                                </label>
                            </div>
                            <div class="radio col-sm-2" style="padding-left: 8px;">
                                <label> <input name="gender" type="radio" value="2"
                                               class="ace" checked="checked"/> <span class="lbl"> 女</span>
                                </label>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="updateBornDate" class="col-sm-2 control-label">出生日期</label>
                        <div class="col-sm-10">
                            <span style="position: relative; z-index: 9999;">
                                <input type="text" class="form-control date-picker" id="updateBornDate" name="city"
                                       value="" placeholder="请输入出生日期" data-date-format="yyyy-mm-dd"/>
                            </span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="updateJobName" class="col-sm-2 control-label">职业名称</label>
                        <div class="col-sm-10">
                            <select id="updateJobName" style="width: 100%;" class="validate[required]">

                            </select>
                        </div>
                    </div>
                    <div class="form-group" hidden>
                        <label for="updateLongitude" class="col-sm-2 control-label">经度</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="updateLongitude" name="city"
                                   value="" />
                        </div>
                    </div>
                    <div class="form-group" hidden>
                        <label for="updateLatitude" class="col-sm-2 control-label">纬度</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" id="updateLatitude" name="city"
                                   value=""/>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="updateType" class="col-sm-2 control-label">用户类型</label>
                        <div class="col-sm-10">
                            <select id="updateType" style="width: 100%;">
                                <!--<option value="1">真实用户</option>-->
                                <option value="2" selected="selected">虚拟用户</option>
                            </select>
                        </div>
                    </div>
                    <div  class="form-group">
                        <label for="updateCountryName" class="col-sm-2 control-label">国家</label>
                        <div class="col-sm-10">
                            <select id="updateCountryName" name="countryName" style="width: 100%;">

                            </select>
                        </div>
                    </div>
                    <div  class="form-group">
                        <label for="updateProvinceName" class="col-sm-2 control-label">省</label>
                        <div class="col-sm-4">
                            <select id="updateProvinceName" style="width: 100%;">

                            </select>
                        </div>
                        <label for="updateCityName" class="col-sm-2 control-label">市</label>
                        <div class="col-sm-4">
                            <select id="updateCityName" style="width: 100%;">

                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="updateAddress" class="col-sm-2 control-label">地址</label>
                        <div class="col-sm-10 input-group">
                            <input type="text" class="form-control validate[required]" id="updateAddress"
                                   name="phoneNo" value="" placeholder="请输入地址"/>
                            <span class="input-group-btn">
                                <button class="btn btn-sm btn-default" type="button" data-toggle="modal" data-target="#positionModal">定位</button>
                            </span>
                        </div>
                    </div>
                    <input type="text" hidden id="userId">
                </form>
            </div>
            <div class="modal-footer">
                <button class="btn btn-primary" form="updateForm" type="submit">保存</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<!-- 修改的modal end-->

<!-- 定位的modal -->
<div class="modal fade" id="positionModal" tabindex="-1">
    <div class="modal-dialog" role="document" style="margin-top: 92px !important;left: 0px;width: 78%;height: 82%;background: white;">
        <div class="modal-content" style="height: 100%;">
            <div class="modal-header">
                <!--<button type="button" class="btn btn-primary" data-dismiss="modal"-->
                <!--aria-label="Close" style="float: right; border: none;">-->
                <!--&lt;!&ndash;<span aria-hidden="true" s>确定</span>&ndash;&gt;-->
                <!--确定-->
                <!--</button>-->
                <h4 class="modal-title" id="exampleModalLabel">用户定位</h4>
                <div class="input-group" style="float: right; width: 70%;top: -28px;">
                    <input class="form-control input-mask-date" type="text" id="userAddress" value="长沙市，岳麓区"/>
                    <span class="input-group-btn">
						<button class="btn btn-sm btn-success" type="button" onclick="codeAddress()">
							搜索
						</button>
                        <button class="btn btn-sm btn-primary" type="button" data-dismiss="modal" aria-label="Close">
							确定
						</button>
					</span>
                </div>
            </div>
            <div class="modal-body" style="height: 108%;">
                <iframe src="../webpage/userMap.html" style="height: 86%;width: 100%;" id="mapWindow"></iframe>
            </div>
        </div>
    </div>
</div>

<!-- 删除的modal start-->
<div class="modal fade" id="deleteModal" tabindex="-1">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"
                        aria-label="Close">
                    <span aria-hidden="true">×</span>
                </button>
                <h4 class="modal-title" id="myModalLabel">删除任务</h4>
            </div>
            <!--Form的id为deleteForm-->
            <form id="deleteForm" data-type="delete">
                <div class="modal-body"></div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <button type="submit" class="btn btn-primary">确认</button>
                </div>
            </form>
        </div>
    </div>
</div>
<!-- 删除的modal end-->
<script src="./assets/js/date-time/bootstrap-datepicker.min.js"></script>
<script type="text/javascript" src="./assets/js/md5.js"></script>
<script src="script/usermanager.js"></script>
<script type="text/javascript">
    function getFocus(result){
        var data = result.detail;
        if(data.nearPois.length != 0){
            $('#address, #updateAddress').val(data.addressComponents.country + data.nearPois[0].address);
            $('#longitude, #updateLongitude').val(data.location.lng);
            $('#latitude, #updateLatitude').val(data.location.lat);
        }else{
            $('#address, #updateAddress').val(data.addressComponents.country + data.addressComponents.province + data.addressComponents.city + data.addressComponents.district + data.addressComponents.street);
            $('#longitude, #updateLongitude').val(data.location.lng);
            $('#latitude, #updateLatitude').val(data.location.lat);
        };
    };
</script>
</body>
</html>